listview: Allocate rubberband at end of size_allocate()
authorBenjamin Otte <otte@redhat.com>
Fri, 26 Jun 2020 00:55:53 +0000 (02:55 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 26 Jun 2020 05:13:32 +0000 (07:13 +0200)
Otherwise the rubberband uses the wrong scroll offsets.

gtk/gtkgridview.c
gtk/gtklistview.c

index 5fde3eb8957402d3e75d96008fc6462002ee0bc1..ac3d49cddae07d543e558864246cb39b8a558e59 100644 (file)
@@ -716,8 +716,6 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
   int x, y;
   guint i;
 
-  gtk_list_base_allocate_rubberband (GTK_LIST_BASE (widget));
-
   orientation = gtk_list_base_get_orientation (GTK_LIST_BASE (self));
   scroll_policy = gtk_list_base_get_scroll_policy (GTK_LIST_BASE (self), orientation);
   opposite_orientation = OPPOSITE_ORIENTATION (orientation);
@@ -877,6 +875,8 @@ gtk_grid_view_size_allocate (GtkWidget *widget,
             }
         }
     }
+
+  gtk_list_base_allocate_rubberband (GTK_LIST_BASE (widget));
 }
 
 static void
index b34b216e7193a52f7219e86baa4f4dc22e413a2d..3bffebdeeae9abfc0a22142c4e9ec54d5403533d 100644 (file)
@@ -567,8 +567,6 @@ gtk_list_view_size_allocate (GtkWidget *widget,
   GtkOrientation orientation, opposite_orientation;
   GtkScrollablePolicy scroll_policy;
 
-  gtk_list_base_allocate_rubberband (GTK_LIST_BASE (self));
-
   orientation = gtk_list_base_get_orientation (GTK_LIST_BASE (self));
   opposite_orientation = OPPOSITE_ORIENTATION (orientation);
   scroll_policy = gtk_list_base_get_scroll_policy (GTK_LIST_BASE (self), orientation);
@@ -658,6 +656,8 @@ gtk_list_view_size_allocate (GtkWidget *widget,
 
       y += row->height * row->parent.n_items;
     }
+
+  gtk_list_base_allocate_rubberband (GTK_LIST_BASE (self));
 }
 
 static void